//
//  YDAPIManager.m
//  IngCard
//
//  Created by kf on 2017/7/7.
//  Copyright © 2017年 IngDan. All rights reserved.
//

#import "YDAPI.h"

#define RelativePath(path) { return NSStringFormat(@"%@/%@",[self baseUrl],path);}

@interface YDAPI()
@property(nonatomic, strong) NSString *baseUrl;
@end

@implementation YDAPI

+ (instancetype)sharedInstance {
    static dispatch_once_t onceToken;
    static YDAPI *instance = nil;
    dispatch_once(&onceToken,^{
        instance = [[super allocWithZone:NULL] init];
    });
    return instance;
}

+ (id)allocWithZone:(struct _NSZone *)zone{
    return [self sharedInstance];
}

-(NSString *)baseUrl
{
    return @"http://devsvcard.ingdan.com";
}

-(NSString *)common_getVerifyCode RelativePath(@"common/verificate");

#pragma mark - ACCOUNT
-(NSString *)account_regist RelativePath(@"account/register");
-(NSString *)account_login RelativePath(@"account/login");
-(NSString *)account_loginout RelativePath(@"account/loginout");
-(NSString *)account_updateBaseInfo RelativePath(@"account/detail");
-(NSString *)account_detail RelativePath(@"account/details");

#pragma mark - AUTH
-(NSString *)auth_bind RelativePath(@"auth/bind");
-(NSString *)auth_callback RelativePath(@"auth/callback");
-(NSString *)auth_detail RelativePath(@"auth/details");
-(NSString *)auth_registerDetail RelativePath(@"auth/register/detail");

#pragma mark - CONTACT
-(NSString *)contact_list RelativePath(@"user/contacts");
-(NSString *)contact_add RelativePath(@"user/contact/add");
-(NSString *)contact_del RelativePath(@"user/contact/del");


#pragma mark - ACTIVITY
-(NSString *)activity_list RelativePath(@"user/activities");
-(NSString *)activity_modify RelativePath(@"user/activity/add");
-(NSString *)activity_sync RelativePath(@"card/messagesync");
//user/contact/del
#pragma mark - MESSAGE

@end
